import { trans } from '@utils/common';
import { post, get, postL, getL } from '@utils/http';
import { SERVE_URL } from '@utils/config';
const urls = url => {
    return SERVE_URL + 'apiExp' + url;
};
export default {
    //=================首页活动 Start
    //首页活动-分页
    async homePageQuery(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(urls('/active/home/pageQuery'), {
                bo: { ...param },
                page: { currentPage: pageNo, pageSize: pageSize },
            })
        );
        return res;
    },
    //活动页配置商品查询
    async relationPageQuery(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(urls('/active/relation/pageQuery'), {
                bo: { ...param },
                page: { currentPage: pageNo, pageSize: pageSize },
            })
        );
        return res;
    },
    //删除活动页配置
    async delete(param) {
        const res = await trans(get(urls('/active/home/delete'), param));
        return res.success;
    },
    //获取商品二维码信息
    async getGoodsQRCode(param) {
        const res = await trans(get(urls('/active/goods/qrCode'), param));
        return res;
    },
    //保存或更新活动页配置
    async saveOrUpdate(param) {
        const res = await trans(post(urls('/active/home/saveOrUpdate'), param));
        return res.success;
    },
    //活动页配置商品添加
    async relationAdd(param) {
        const res = await trans(post(urls('/active/relation/add'), param));
        return res.success;
    },
    //活动页商品配置删除
    async relationDelete(param) {
        const res = await trans(post(urls('/active/relation/delete'), param));
        return res.success;
    },
    //==================首页活动 End

};
